import 'dart:async';

import 'package:flutter/foundation.dart';
import 'package:flutter/widgets.dart';
import 'package:flutter_localizations/flutter_localizations.dart';
import 'package:intl/intl.dart' as intl;

import 'app_localizations_en.dart';
import 'app_localizations_zh.dart';

/// Callers can lookup localized strings with an instance of AppLocalizations
/// returned by `AppLocalizations.of(context)`.
///
/// Applications need to include `AppLocalizations.delegate()` in their app's
/// `localizationDelegates` list, and the locales they support in the app's
/// `supportedLocales` list. For example:
///
/// ```dart
/// import 'gen/app_localizations.dart';
///
/// return MaterialApp(
///   localizationsDelegates: AppLocalizations.localizationsDelegates,
///   supportedLocales: AppLocalizations.supportedLocales,
///   home: MyApplicationHome(),
/// );
/// ```
///
/// ## Update pubspec.yaml
///
/// Please make sure to update your pubspec.yaml to include the following
/// packages:
///
/// ```yaml
/// dependencies:
///   # Internationalization support.
///   flutter_localizations:
///     sdk: flutter
///   intl: any # Use the pinned version from flutter_localizations
///
///   # Rest of dependencies
/// ```
///
/// ## iOS Applications
///
/// iOS applications define key application metadata, including supported
/// locales, in an Info.plist file that is built into the application bundle.
/// To configure the locales supported by your app, you’ll need to edit this
/// file.
///
/// First, open your project’s ios/Runner.xcworkspace Xcode workspace file.
/// Then, in the Project Navigator, open the Info.plist file under the Runner
/// project’s Runner folder.
///
/// Next, select the Information Property List item, select Add Item from the
/// Editor menu, then select Localizations from the pop-up menu.
///
/// Select and expand the newly-created Localizations item then, for each
/// locale your application supports, add a new item and select the locale
/// you wish to add from the pop-up menu in the Value field. This list should
/// be consistent with the languages listed in the AppLocalizations.supportedLocales
/// property.
abstract class AppLocalizations {
  AppLocalizations(String locale) : localeName = intl.Intl.canonicalizedLocale(locale.toString());

  final String localeName;

  static AppLocalizations of(BuildContext context) {
    return Localizations.of<AppLocalizations>(context, AppLocalizations)!;
  }

  static const LocalizationsDelegate<AppLocalizations> delegate = _AppLocalizationsDelegate();

  /// A list of this localizations delegate along with the default localizations
  /// delegates.
  ///
  /// Returns a list of localizations delegates containing this delegate along with
  /// GlobalMaterialLocalizations.delegate, GlobalCupertinoLocalizations.delegate,
  /// and GlobalWidgetsLocalizations.delegate.
  ///
  /// Additional delegates can be added by appending to this list in
  /// MaterialApp. This list does not have to be used at all if a custom list
  /// of delegates is preferred or required.
  static const List<LocalizationsDelegate<dynamic>> localizationsDelegates = <LocalizationsDelegate<dynamic>>[
    delegate,
    GlobalMaterialLocalizations.delegate,
    GlobalCupertinoLocalizations.delegate,
    GlobalWidgetsLocalizations.delegate,
  ];

  /// A list of this localizations delegate's supported locales.
  static const List<Locale> supportedLocales = <Locale>[
    Locale('en'),
    Locale('zh')
  ];

  /// No description provided for @appName.
  ///
  /// In zh, this message translates to:
  /// **'PDA'**
  String get appName;

  /// No description provided for @please_wait.
  ///
  /// In zh, this message translates to:
  /// **'请稍后...'**
  String get please_wait;

  /// No description provided for @response_error_hint.
  ///
  /// In zh, this message translates to:
  /// **'服务器请求异常'**
  String get response_error_hint;

  /// No description provided for @connect_time_out_hint.
  ///
  /// In zh, this message translates to:
  /// **'网络连接超时，请检查网络设置'**
  String get connect_time_out_hint;

  /// No description provided for @response_time_out_hint.
  ///
  /// In zh, this message translates to:
  /// **'服务器响应超时，请稍后重试'**
  String get response_time_out_hint;

  /// No description provided for @request_cancel_hint.
  ///
  /// In zh, this message translates to:
  /// **'请求已被取消，请重新请求'**
  String get request_cancel_hint;

  /// No description provided for @http_400_error.
  ///
  /// In zh, this message translates to:
  /// **'请求语法错误'**
  String get http_400_error;

  /// No description provided for @http_401_error.
  ///
  /// In zh, this message translates to:
  /// **'未授权，请登录'**
  String get http_401_error;

  /// No description provided for @http_403_error.
  ///
  /// In zh, this message translates to:
  /// **'拒绝访问'**
  String get http_403_error;

  /// No description provided for @http_404_error.
  ///
  /// In zh, this message translates to:
  /// **'请求出错'**
  String get http_404_error;

  /// No description provided for @http_408_error.
  ///
  /// In zh, this message translates to:
  /// **'请求超时'**
  String get http_408_error;

  /// No description provided for @http_500_error.
  ///
  /// In zh, this message translates to:
  /// **'服务器异常'**
  String get http_500_error;

  /// No description provided for @http_501_error.
  ///
  /// In zh, this message translates to:
  /// **'服务未实现'**
  String get http_501_error;

  /// No description provided for @http_502_error.
  ///
  /// In zh, this message translates to:
  /// **'网关错误'**
  String get http_502_error;

  /// No description provided for @http_503_error.
  ///
  /// In zh, this message translates to:
  /// **'服务不可用'**
  String get http_503_error;

  /// No description provided for @http_504_error.
  ///
  /// In zh, this message translates to:
  /// **'网关超时'**
  String get http_504_error;

  /// No description provided for @http_505_error.
  ///
  /// In zh, this message translates to:
  /// **'HTTP版本不受支持'**
  String get http_505_error;

  /// No description provided for @http_other_error.
  ///
  /// In zh, this message translates to:
  /// **'请求失败，错误码：'**
  String get http_other_error;

  /// No description provided for @back_fix.
  ///
  /// In zh, this message translates to:
  /// **'返修'**
  String get back_fix;

  /// No description provided for @mat_bind.
  ///
  /// In zh, this message translates to:
  /// **'物料绑定'**
  String get mat_bind;

  /// No description provided for @renovate_list.
  ///
  /// In zh, this message translates to:
  /// **'装箱'**
  String get renovate_list;

  /// No description provided for @renovate_setting.
  ///
  /// In zh, this message translates to:
  /// **'装箱设置'**
  String get renovate_setting;

  /// No description provided for @my.
  ///
  /// In zh, this message translates to:
  /// **'我的'**
  String get my;

  /// No description provided for @all.
  ///
  /// In zh, this message translates to:
  /// **'全部'**
  String get all;

  /// No description provided for @wait_remake.
  ///
  /// In zh, this message translates to:
  /// **'待返修'**
  String get wait_remake;

  /// No description provided for @remakeing.
  ///
  /// In zh, this message translates to:
  /// **'返修中'**
  String get remakeing;

  /// No description provided for @edit.
  ///
  /// In zh, this message translates to:
  /// **'编辑'**
  String get edit;

  /// No description provided for @delete.
  ///
  /// In zh, this message translates to:
  /// **'删除'**
  String get delete;

  /// No description provided for @end_remake.
  ///
  /// In zh, this message translates to:
  /// **'已返修'**
  String get end_remake;

  /// No description provided for @please_input.
  ///
  /// In zh, this message translates to:
  /// **'请输入'**
  String get please_input;

  /// No description provided for @one_box_num.
  ///
  /// In zh, this message translates to:
  /// **'每箱数量'**
  String get one_box_num;

  /// No description provided for @full_box_submit.
  ///
  /// In zh, this message translates to:
  /// **'满箱自动提交'**
  String get full_box_submit;

  /// No description provided for @start.
  ///
  /// In zh, this message translates to:
  /// **'启动'**
  String get start;

  /// No description provided for @not_start.
  ///
  /// In zh, this message translates to:
  /// **'不启动'**
  String get not_start;

  /// No description provided for @confirm.
  ///
  /// In zh, this message translates to:
  /// **'确定'**
  String get confirm;

  /// No description provided for @please_input_box_num.
  ///
  /// In zh, this message translates to:
  /// **'请输入每箱数量'**
  String get please_input_box_num;

  /// No description provided for @current_version_no.
  ///
  /// In zh, this message translates to:
  /// **'当前版本号'**
  String get current_version_no;

  /// No description provided for @login_out.
  ///
  /// In zh, this message translates to:
  /// **'退出登录'**
  String get login_out;

  /// No description provided for @confirm_to_login_out.
  ///
  /// In zh, this message translates to:
  /// **'确定退出当前账号吗?'**
  String get confirm_to_login_out;

  /// No description provided for @remake_result.
  ///
  /// In zh, this message translates to:
  /// **'返修结果'**
  String get remake_result;

  /// No description provided for @back_procedure.
  ///
  /// In zh, this message translates to:
  /// **'返回工序'**
  String get back_procedure;

  /// No description provided for @mat_bind_info.
  ///
  /// In zh, this message translates to:
  /// **'物料绑定信息'**
  String get mat_bind_info;

  /// No description provided for @see.
  ///
  /// In zh, this message translates to:
  /// **'查看'**
  String get see;

  /// No description provided for @remark.
  ///
  /// In zh, this message translates to:
  /// **'备注'**
  String get remark;

  /// No description provided for @product_name.
  ///
  /// In zh, this message translates to:
  /// **'产品名称'**
  String get product_name;

  /// No description provided for @product_no.
  ///
  /// In zh, this message translates to:
  /// **'产品编号'**
  String get product_no;

  /// No description provided for @produce_procedure.
  ///
  /// In zh, this message translates to:
  /// **'产生工序'**
  String get produce_procedure;

  /// No description provided for @remake_reason.
  ///
  /// In zh, this message translates to:
  /// **'返修原因'**
  String get remake_reason;

  /// No description provided for @product_code.
  ///
  /// In zh, this message translates to:
  /// **'产品条码'**
  String get product_code;

  /// No description provided for @plan_no.
  ///
  /// In zh, this message translates to:
  /// **'计划单号'**
  String get plan_no;

  /// No description provided for @task_no.
  ///
  /// In zh, this message translates to:
  /// **'任务单号'**
  String get task_no;

  /// No description provided for @start_time.
  ///
  /// In zh, this message translates to:
  /// **'发起时间'**
  String get start_time;

  /// No description provided for @produce_person.
  ///
  /// In zh, this message translates to:
  /// **'生产人'**
  String get produce_person;

  /// No description provided for @remake_start_time.
  ///
  /// In zh, this message translates to:
  /// **'返修开始时间'**
  String get remake_start_time;

  /// No description provided for @remake_person.
  ///
  /// In zh, this message translates to:
  /// **'返修人'**
  String get remake_person;

  /// No description provided for @remake_end_time.
  ///
  /// In zh, this message translates to:
  /// **'返修结束时间'**
  String get remake_end_time;

  /// No description provided for @start_remake.
  ///
  /// In zh, this message translates to:
  /// **'开始返修'**
  String get start_remake;

  /// No description provided for @bind_record.
  ///
  /// In zh, this message translates to:
  /// **'绑定记录'**
  String get bind_record;

  /// No description provided for @remake_product.
  ///
  /// In zh, this message translates to:
  /// **'返修产品'**
  String get remake_product;

  /// No description provided for @remake_details.
  ///
  /// In zh, this message translates to:
  /// **'返修详情'**
  String get remake_details;

  /// No description provided for @total.
  ///
  /// In zh, this message translates to:
  /// **'共'**
  String get total;

  /// No description provided for @bar.
  ///
  /// In zh, this message translates to:
  /// **'条'**
  String get bar;

  /// No description provided for @confirm_delete_data.
  ///
  /// In zh, this message translates to:
  /// **'确定删除该条数据吗?'**
  String get confirm_delete_data;

  /// No description provided for @not_permission.
  ///
  /// In zh, this message translates to:
  /// **'没有功能权限，请联系管理员'**
  String get not_permission;

  /// No description provided for @delete_success.
  ///
  /// In zh, this message translates to:
  /// **'删除成功'**
  String get delete_success;

  /// No description provided for @please_choose.
  ///
  /// In zh, this message translates to:
  /// **'请选择'**
  String get please_choose;

  /// No description provided for @no_data.
  ///
  /// In zh, this message translates to:
  /// **'暂无数据'**
  String get no_data;

  /// No description provided for @binded.
  ///
  /// In zh, this message translates to:
  /// **'已绑定'**
  String get binded;

  /// No description provided for @bindMaterialTag.
  ///
  /// In zh, this message translates to:
  /// **'绑定物料标签'**
  String get bindMaterialTag;

  /// No description provided for @scan_material_tag.
  ///
  /// In zh, this message translates to:
  /// **'请扫描替换的物料标签码'**
  String get scan_material_tag;

  /// No description provided for @material_code.
  ///
  /// In zh, this message translates to:
  /// **'物料条码'**
  String get material_code;

  /// No description provided for @material_info_batch_num.
  ///
  /// In zh, this message translates to:
  /// **'批次号'**
  String get material_info_batch_num;

  /// No description provided for @material_info_suppliers.
  ///
  /// In zh, this message translates to:
  /// **'供应商'**
  String get material_info_suppliers;

  /// No description provided for @material_info_remake.
  ///
  /// In zh, this message translates to:
  /// **'备注'**
  String get material_info_remake;

  /// No description provided for @no_more_data.
  ///
  /// In zh, this message translates to:
  /// **'没有更多数据了'**
  String get no_more_data;

  /// No description provided for @please_input_phone.
  ///
  /// In zh, this message translates to:
  /// **'请输入手机号'**
  String get please_input_phone;

  /// No description provided for @forget_pwd.
  ///
  /// In zh, this message translates to:
  /// **'忘记密码?'**
  String get forget_pwd;

  /// No description provided for @login.
  ///
  /// In zh, this message translates to:
  /// **'登录'**
  String get login;

  /// No description provided for @please_input_pwd.
  ///
  /// In zh, this message translates to:
  /// **'请输入密码'**
  String get please_input_pwd;

  /// No description provided for @login_failed.
  ///
  /// In zh, this message translates to:
  /// **'登录失败'**
  String get login_failed;

  /// No description provided for @login_ok.
  ///
  /// In zh, this message translates to:
  /// **'登录成功!'**
  String get login_ok;

  /// No description provided for @save_label.
  ///
  /// In zh, this message translates to:
  /// **'保存'**
  String get save_label;

  /// No description provided for @material_info_scan_content.
  ///
  /// In zh, this message translates to:
  /// **'扫码内容'**
  String get material_info_scan_content;

  /// No description provided for @material_info_no.
  ///
  /// In zh, this message translates to:
  /// **'物料编号'**
  String get material_info_no;

  /// No description provided for @material_info_name.
  ///
  /// In zh, this message translates to:
  /// **'物料名称'**
  String get material_info_name;

  /// No description provided for @material_info_num.
  ///
  /// In zh, this message translates to:
  /// **'数量'**
  String get material_info_num;

  /// No description provided for @input_right_num.
  ///
  /// In zh, this message translates to:
  /// **'输入格式不正确'**
  String get input_right_num;

  /// No description provided for @finish_remake.
  ///
  /// In zh, this message translates to:
  /// **'结束返修'**
  String get finish_remake;

  /// No description provided for @no_remake_result.
  ///
  /// In zh, this message translates to:
  /// **'暂无可选返修结论'**
  String get no_remake_result;

  /// No description provided for @no_remake_produce.
  ///
  /// In zh, this message translates to:
  /// **'暂无可选返回工序'**
  String get no_remake_produce;

  /// No description provided for @search_scan.
  ///
  /// In zh, this message translates to:
  /// **'请扫描物料码'**
  String get search_scan;

  /// No description provided for @renovate_submit.
  ///
  /// In zh, this message translates to:
  /// **'提交'**
  String get renovate_submit;

  /// No description provided for @remake_add.
  ///
  /// In zh, this message translates to:
  /// **'新增返修'**
  String get remake_add;

  /// No description provided for @remake_taskNo.
  ///
  /// In zh, this message translates to:
  /// **'任务单'**
  String get remake_taskNo;

  /// No description provided for @public_do_success.
  ///
  /// In zh, this message translates to:
  /// **'操作成功'**
  String get public_do_success;

  /// No description provided for @remake_inputMode.
  ///
  /// In zh, this message translates to:
  /// **'录入模式'**
  String get remake_inputMode;

  /// No description provided for @material_info_input_code.
  ///
  /// In zh, this message translates to:
  /// **'请输入物料唯一码'**
  String get material_info_input_code;

  /// No description provided for @un_query_material_data_hint.
  ///
  /// In zh, this message translates to:
  /// **'未查询到物料标签数据'**
  String get un_query_material_data_hint;

  /// No description provided for @same_material_record.
  ///
  /// In zh, this message translates to:
  /// **'已有相同物料标签码绑定，确定进行该操作吗?'**
  String get same_material_record;

  /// No description provided for @edit_bind_record.
  ///
  /// In zh, this message translates to:
  /// **'编辑绑定记录'**
  String get edit_bind_record;

  /// No description provided for @renovate_set_msg.
  ///
  /// In zh, this message translates to:
  /// **'请设置每箱数量'**
  String get renovate_set_msg;

  /// No description provided for @renovate_scan_code.
  ///
  /// In zh, this message translates to:
  /// **'扫码箱码'**
  String get renovate_scan_code;

  /// No description provided for @renovate_scan_product.
  ///
  /// In zh, this message translates to:
  /// **'扫码产品码'**
  String get renovate_scan_product;

  /// No description provided for @renovate_scan_unique_code.
  ///
  /// In zh, this message translates to:
  /// **'请扫码装箱唯一码'**
  String get renovate_scan_unique_code;

  /// No description provided for @renovate_placeholder.
  ///
  /// In zh, this message translates to:
  /// **'请扫描'**
  String get renovate_placeholder;

  /// No description provided for @renovate_complete_msg.
  ///
  /// In zh, this message translates to:
  /// **'当前任务单已装完,无法提交'**
  String get renovate_complete_msg;

  /// No description provided for @me_is_know.
  ///
  /// In zh, this message translates to:
  /// **'我知道了'**
  String get me_is_know;

  /// No description provided for @renovate_info.
  ///
  /// In zh, this message translates to:
  /// **'装箱信息'**
  String get renovate_info;

  /// No description provided for @renovate_scan_set.
  ///
  /// In zh, this message translates to:
  /// **'设置'**
  String get renovate_scan_set;

  /// No description provided for @task_number_label.
  ///
  /// In zh, this message translates to:
  /// **'任务数'**
  String get task_number_label;

  /// No description provided for @renovate_quantity.
  ///
  /// In zh, this message translates to:
  /// **'已装箱数'**
  String get renovate_quantity;

  /// No description provided for @renovate_products.
  ///
  /// In zh, this message translates to:
  /// **'已装产品'**
  String get renovate_products;

  /// No description provided for @wait_check_label.
  ///
  /// In zh, this message translates to:
  /// **'待审核'**
  String get wait_check_label;

  /// No description provided for @check_done_label.
  ///
  /// In zh, this message translates to:
  /// **'已审核'**
  String get check_done_label;

  /// No description provided for @in_product.
  ///
  /// In zh, this message translates to:
  /// **'生产中'**
  String get in_product;

  /// No description provided for @completed.
  ///
  /// In zh, this message translates to:
  /// **'已完工'**
  String get completed;

  /// No description provided for @pad_Packing.
  ///
  /// In zh, this message translates to:
  /// **'装箱'**
  String get pad_Packing;

  /// No description provided for @renovate_select.
  ///
  /// In zh, this message translates to:
  /// **'选择任务单'**
  String get renovate_select;

  /// No description provided for @renovate_modify.
  ///
  /// In zh, this message translates to:
  /// **'修改'**
  String get renovate_modify;

  /// No description provided for @renovate_change.
  ///
  /// In zh, this message translates to:
  /// **'切换'**
  String get renovate_change;

  /// No description provided for @renovate_repeat_msg.
  ///
  /// In zh, this message translates to:
  /// **'该产品码已扫入，不可重复扫描'**
  String get renovate_repeat_msg;

  /// No description provided for @has_replace.
  ///
  /// In zh, this message translates to:
  /// **'已替换'**
  String get has_replace;

  /// No description provided for @edit_bind_info.
  ///
  /// In zh, this message translates to:
  /// **'编辑绑定信息'**
  String get edit_bind_info;

  /// No description provided for @material_bind_info.
  ///
  /// In zh, this message translates to:
  /// **'物料绑定信息'**
  String get material_bind_info;

  /// No description provided for @cancel.
  ///
  /// In zh, this message translates to:
  /// **'取消'**
  String get cancel;

  /// No description provided for @save_success.
  ///
  /// In zh, this message translates to:
  /// **'保存成功'**
  String get save_success;

  /// No description provided for @material_add_same.
  ///
  /// In zh, this message translates to:
  /// **'提示该物料标签已经添加'**
  String get material_add_same;

  /// No description provided for @no_task_please_choose_hint.
  ///
  /// In zh, this message translates to:
  /// **'当前无任务单，请选择'**
  String get no_task_please_choose_hint;

  /// No description provided for @material_bind_procedure_invalid_hint.
  ///
  /// In zh, this message translates to:
  /// **'当前工序不支持该功能\n物料绑定需通过产品过站进行操作'**
  String get material_bind_procedure_invalid_hint;

  /// No description provided for @material_bind_procedure_empty_hint.
  ///
  /// In zh, this message translates to:
  /// **'当前无工序\n请选择该任务单的相关工序'**
  String get material_bind_procedure_empty_hint;
}

class _AppLocalizationsDelegate extends LocalizationsDelegate<AppLocalizations> {
  const _AppLocalizationsDelegate();

  @override
  Future<AppLocalizations> load(Locale locale) {
    return SynchronousFuture<AppLocalizations>(lookupAppLocalizations(locale));
  }

  @override
  bool isSupported(Locale locale) => <String>['en', 'zh'].contains(locale.languageCode);

  @override
  bool shouldReload(_AppLocalizationsDelegate old) => false;
}

AppLocalizations lookupAppLocalizations(Locale locale) {


  // Lookup logic when only language code is specified.
  switch (locale.languageCode) {
    case 'en': return AppLocalizationsEn();
    case 'zh': return AppLocalizationsZh();
  }

  throw FlutterError(
    'AppLocalizations.delegate failed to load unsupported locale "$locale". This is likely '
    'an issue with the localizations generation tool. Please file an issue '
    'on GitHub with a reproducible sample app and the gen-l10n configuration '
    'that was used.'
  );
}
